
 import { MessageBox } from 'mint-ui';
 
 export default {
   install(Vue){
		 Vue.prototype.d = function (){
			 
			 localStorage.setItem('loginsucc',1);
			 //判断是否在微信打开
			 var url1 = this.$route.fullPath;
			 var url = window.location.href.split(':')[0];
			 // console.log()
			 // console.log(url1)
			 var url2 = encodeURIComponent(url1);
			 window.localStorage.setItem('hrefurl',url2);
			 // console.log(url);
			 var addressurl = this.$store.state.url;
			 var ua = navigator.userAgent.toLowerCase();
			 var isWeixin = ua.indexOf('micromessenger') != -1;
			 if (isWeixin) {
				sessionStorage.setItem('logintap',1);
				var href = addressurl+'User/WechatLogin?to='+url+'&route=gd&fromsource=1'
				// var href = addressurl+'User/WechatLogin?route=gd&fromsource=1'
			 	window.location.href = href;
			 	// window.location.href = href;
				// this.$router.replace(href);
				// window.open(href)
				// console.log(href)
			 	// window.location.href = addressurl+'User/WechatLogin?route=gd&fromsource=1&connect_redirect=1#wechat_redirect'
			 } else {
			 	 this.$router.push({
			 		 path: '/denglu'
			 	 })
			 }
		 };
   }
 };



